<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>面向对象-封装</title>
</head>

<script>
    function Dog() {
        this.leg = 4;
        this.bark = function(){
            alert("wangwang")
        }
    }

    var huzi = new Dog();
    huzi.bark();
</script>
<body>

</body>
</html>

